{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "!git config --global user.name \"lyhue1991\"\n",
    "!git config --global user.email \"lyhue1991@163.com\"\n",
    "\n",
    "# 出现一些类似 warning: LF will be replaced by CRLF in <file-name>. 可启用如下设置。\n",
    "!git config --global core.autocrlf false\n",
    "\n",
    "# 配置打印历史commit的快捷命令\n",
    "!git config --global alias.lg \"log --oneline --graph --all\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-08-22T11:09:34.731929Z",
     "start_time": "2020-08-22T11:09:34.556119Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Reinitialized existing Git repository in /Users/liangyun/CodeFiles/PythonAiRoad/.git/\r\n"
     ]
    }
   ],
   "source": [
    "!git init"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-09-07T01:41:38.941843Z",
     "start_time": "2020-09-07T01:41:38.692546Z"
    }
   },
   "outputs": [],
   "source": [
    "!git add -A "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-09-07T01:41:47.324431Z",
     "start_time": "2020-09-07T01:41:47.088699Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[master 4e4c620] add matplotlib\r\n",
      " 3 files changed, 166 insertions(+), 24 deletions(-)\r\n",
      " create mode 100644 data/SimHei.ttf\r\n",
      " create mode 100644 matplotlib支持中文显示的两种方法.md\r\n"
     ]
    }
   ],
   "source": [
    "!git commit -m\"add matplotlib\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "!git remote add origin git@github.com:lyhue1991/PythonAiRoad"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "usage: git remote set-url [--push] <name> <newurl> [<oldurl>]\r\n",
      "   or: git remote set-url --add <name> <newurl>\r\n",
      "   or: git remote set-url --delete <name> <url>\r\n",
      "\r\n",
      "    --push                manipulate push URLs\r\n",
      "    --add                 add URL\r\n",
      "    --delete              delete URLs\r\n",
      "\r\n"
     ]
    }
   ],
   "source": [
    "#!git remote set-url origin"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2020-09-07T01:41:57.080849Z",
     "start_time": "2020-09-07T01:41:50.210110Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Enumerating objects: 431, done.\n",
      "Counting objects: 100% (431/431), done.\n",
      "Delta compression using up to 4 threads\n",
      "Compressing objects: 100% (430/430), done.\n",
      "Writing objects: 100% (431/431), 37.64 MiB | 1.13 MiB/s, done.\n",
      "Total 431 (delta 125), reused 0 (delta 0)\n",
      "remote: Resolving deltas: 100% (125/125), done.\u001b[K\n",
      "To github.com:lyhue1991/PythonAiRoad\n",
      " + 66cc214...4e4c620 master -> master (forced update)\n"
     ]
    }
   ],
   "source": [
    "!git push -f origin master "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "!git rebase origin/master"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
